﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Product.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Site.ViewModels.CompanyIndexModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Lib.Paging" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Danh bạ doanh nghiệp <%=Model.CompanyType!=null? Html.Encode(Model.CompanyType.Name):" bất động sản" %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="content">
    <% Html.RenderAction("GetCities", "Company", new { id = Model.CompanyTypeID, cityid = Model.CityID }); %>
    <div class="listcus">
    
    <%foreach (var item in Model.Companies)
      { %>
    <div class="cusitem">
        <div class="itemleft">
            <%var imgPath=item.ImagePath!=null && item.ImagePath!=string.Empty?
                SDT.Lib.Common.Utils.GenThumbnail(item.ID,110,110,item.ImagePath,Model.ImagePath, Model.ImageUrl):string.Empty;
              imgPath = imgPath == string.Empty ? SDT.Lib.Common.Globals.DefaultLogo : imgPath;
           %>
            <img width="110px" height="110px" alt="<%=Html.Encode(item.Name) %>" title="<%=Html.Encode(item.Name) %>" src="<%=imgPath %>" />
        </div>
        <div class="itemright">
           <a href="/company/more/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name) %>"><span class="itemtitle"><%=Html.Encode(item.Name)%></span></a>
            <p><b>Địa chỉ: </b><%=Html.Encode(item.Address) %></p>
            <p><b>Điện thoại: </b><%=Html.Encode(item.Phone) %></p>
            <p><b>Email: </b><%=Html.Encode(item.Email) %></p>
        </div>
    </div>
    <%} %>
   </div>
   <div class="clear"></div>
    <%if (Model.Companies.Count > 0)
      { %>
    <div class="pagebarUTH fr" style="text-align:right">
        Trang <%= Model.Companies.PageNumber%>/<%= Model.Companies.PageCount%>
        <%= Html.Pager(Model.Companies.PageSize, Model.Companies.PageNumber, Model.Companies.TotalItemCount)%>
     </div>	
    <%}
      else
      { %>
      <div class="noresult">Dữ liệu đang được cập nhật</div>
    <%} %>    
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PathContent" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="LeftContent" runat="server">
<% Html.RenderAction("GetLeft", "Company", new { id = Model.CompanyTypeID}); %>
<% Html.RenderAction("Hot", "Company", new { number = 5, typeid = Model.CompanyTypeID, cityid = Model.CityID, distrid = Model.DistrictID,title="Doanh nghiệp tiêu biểu", order = "ID", orderDir = "desc" }); %>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="RightContent" runat="server">
<% Html.RenderAction("Search", "Company", new { id = Model.CompanyTypeID, cityid = Model.CityID, distrid = Model.DistrictID }); %>
<div class="clear"></div>
<% Html.RenderAction("Hot", "Project", new { number = 3, catid = 0, hotYN = 1, pubYN = 1, title = "Dự án nổi bật", prjorder = "ID", prjorderDir = "desc" }); %>
</asp:Content>
